
/**
 * 手机码验证
 * */
export const isphone = function (phone) {
  let reg = /^(?:13\d|14\d|15\d|17\d|18\d)\d{8}$/
  return reg.test(phone)
}

/**
  * 邮箱验证
   * */
export const isEmail = function (email) {
  let reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/
  return reg.test(email)
}
/**
 * 判断是否为微信浏览器
 * */
export const isWeixin = function () {
  return navigator.userAgent.toLowerCase().match(/MicroMessenger/i) === 'micromessenger'
}

/**
 * 判断是否为IOS系统
 * */
export const isIOS = function () {
  let userAgent = navigator.userAgent.toLowerCase()
  let keywords = ['iphone', 'ipad', 'ios']
  for (let val of keywords) {
    if (userAgent.includes(val)) return true
  }
  return false
}
